<?php
namespace Admin\Controller;
use Think\Controller;
class FindController extends BaseController {
    public function Findlist()
    {

        $findModel=M('find');
    $find=$findModel->order('id asc')->
select();
    $this->find=$find;
        //dump($users);//输出数组
        $this->display();
    }


     public function del($id)


    { 
        $id=$_GET['id'];
        $data['picture']= '../public/Admin/photo/';
  
        $filepath="../public/Admin/photo/".$data['picture'];
      
        if(!empty($data['picture']))
        {
            unlink($filepath);
            echo "图片删除成功".'<br>';
        }
         $findmodel=M('find'); 
        if (false!==$findmodel->where("id=$id")->delete()) 
        {
            $this->success('删除成功！');
        } else 
        {
            $this->error('删除失败');
        }
    
  }
   public function detail()
    {
 $id=$_GET['id'];
        $findModel=M('find');
    $find=$findModel->order('id asc')->where("id=$id")->
select();
    $this->find=$find;
        //dump($users);//输出数组
        $this->display();
    }


}